package mr.ali.videoapp.portal.pay;


import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 */
@RestController
@Slf4j
public class WxPayController {

   @Autowired
   private WxPayService wxPayService;

   @Autowired
   private WxPayIkranService wxPayikranService;

   @PostMapping("/unifiedOrder")
   public UnifiedOrderResponse unifiedOrder(@RequestBody UnifiedOrderRequest request) throws Exception {
      log.info("微信支付统一下单请求参数：{}", request);
      return wxPayService.unifiedOrder(request);
   }

   @PostMapping("/ikran/unifiedOrder")
   public UnifiedOrderResponse IkranunifiedOrder(@RequestBody UnifiedOrderRequest request) throws Exception {
      log.info("微信支付统一下单请求参数：{}", request);
      return wxPayikranService.IkranunifiedOrder(request);
   }
}